#include "server.hpp"

int main()
{
    Buffer buf;
    std::string str = "hello!!";
    buf.WriteStringAndPush(str);
    std::string tmp;
    Buffer buf1;
    buf1.WriteBufferAndPush(buf);
    std::string tmp1;
    tmp1 = buf1.ReadAsStringPop(buf1.ReadAbleSize());
    tmp = buf.ReadAsStringPop(buf.ReadAbleSize());
    std::cout << tmp << std::endl;
    std::cout << buf.ReadAbleSize() << std::endl;
    std::cout << "-----------------------------------" << std::endl;
    std::cout << tmp1 << std::endl;
    std::cout << buf1.ReadAbleSize() << std::endl;

    Buffer buf2;
    for(int i = 0; i < 500; i++)
    {
        std::string str = "hello!!" + std::to_string(i) + '\n';
        buf2.WriteStringAndPush(str);
    }
    std::string tmp2;
    tmp2 = buf2.ReadAsStringPop(buf2.ReadAbleSize());
    std::cout << tmp2 << std::endl;
    return 0;
}
